	<!-- 往期巡检列表（基础版巡检--查看往期巡检） -->
<template>
  <view class="flex-col page">
	  <view class="back-w" style="">
	  	<view class="u-m-l-10" @click="Back()">
	  		<u-icon name="arrow-left" color="#000000" size="20"></u-icon>
	  	</view>
	  	<view class="f-w-l">
	  		往期巡检列表
	  	</view>
	  </view>
    <view class="flex-col group_4" style="margin-top: 120rpx;">
      <view class="flex-col list" v-if="this.list!=''">
        <view class="flex-col list-item"  v-for="(item, i) in list" :key="i">
          <view class="justify-between">
            <view class="flex-row">
              <image
					:src="$IMG_URL+'16557868145920698024.png'"
                class="image_5"
              />
              <text class="text_1">第{{item.num}}次巡检</text>
            </view>
            <text class="text_3" v-if="item.status == 3">已完成</text>
			<text class="text_4" v-else-if="item.status == 2">待评价</text>
			<text class="text_4" v-else-if="item.status == 0">未开始</text>
			<text class="text_4" v-else-if="item.status == 1">进行中</text>
          </view>
          <view class="flex-col group_7">
            <view class="flex-row group_8">
              <view class="flex-col items-start group_9">
                <text class="text_5">巡检工序：{{item.processName}}</text>
                <text class="text_7" v-if="item.status == 3">巡检子项目：{{item.childProcessName}}</text>
				 <text class="text_7" v-else>巡检类型：{{item.inspectionType}}</text>
                <text class="text_9">巡检时间：{{item.inspectionDate}}</text>
              </view>
            </view>
			<view class="flex-col items-center text-wrapper" @click="toplan(item)"><text class="text_11">查看详情</text></view>
          </view>
        </view>
      </view>
	  <view v-else>
		  <u-empty style="height: 100vh;" mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png">
		  </u-empty>
	  </view>
	  
    </view>
  
  </view>
  
</template>

<script>
  export default {
    components: {},
    data() {
      return {
        list: [],
		id:'',
		inspectionFrequencyId:''
      };
    },
	onLoad(option) {
		// console.log(option.id);
		this.id = option.id;
		this.inspectionFrequencyId= option.inspectionFrequencyId
	},
	created() {
		this.getdatelist()
		uni.startPullDownRefresh();
		setTimeout(function() {
			uni.stopPullDownRefresh();
		}, 1000);
	},
    methods: {
		Back() {
			
			let  pageNum = 2
			let pages = getCurrentPages(); // 当前页面
			let beforePage = pages[pages.length - pageNum]; 
			uni.navigateBack({
				success: function() {
					console.log(beforePage)
					beforePage.$vm.$refs.PatroService.getxjwtlist();
				}
						
			})
		},
		onPullDownRefresh() {
			this.getdatelist()
			setTimeout(function () {
				uni.stopPullDownRefresh();
			}, 1000);
		},
			toplan(item){
				// console.log(item)
				uni.navigateTo({
					url:'/pages/onSite/onSiteIndex/PatroSerD/patroerexplan?id='+item.id
				})
			},
			getdatelist(){
				this.$http('onsite.seePatrol',{
					ordersId:this.id
				}).then(res=>{
					console.log(res,'getdatelist')
					if(res.code ==200){
						this.list = res.data;
						
					}
				}).catch(err=>{
					
				})
			}
		},
  };
</script>

<style scoped lang="css">
	.back-w {
		display: flex;
		flex-direction: row;
		padding-top: 50rpx;
		/* align-items: center; */
		width: 100vw;
		height: 120rpx;
		background-color: #ffffff;
		position: fixed;
		top: 0;
		left: 0;
		z-index: 9;
	}
	
	.f-w-l {
		display: flex;
		flex-direction: row;
		font-weight: bold;
		margin-left: 33%;
	}
  .list-item {
    padding: 30rpx 23rpx 24rpx 24rpx;
    background-color: #ffffff;
    border-radius: 16rpx;
  }
  .group_7 {
    margin-top: 33rpx;
  }
  .text_3 {
    color: #1d6aff;
    font-size: 28rpx;
    font-family: '.AppleSystemUIFont';
    line-height: 33rpx;
  }
	.text_4 {
	  color: #FF371D;
	  font-size: 28rpx;
	  font-family: '.AppleSystemUIFont';
	  line-height: 33rpx;
	}
  .group_8 {
    padding-bottom: 24rpx;
    border-bottom: solid 1rpx #eeeeee;
  }
  .text-wrapper {
    margin-top: 24rpx;
    padding: 9rpx 0 19rpx;
    align-self: flex-end;
    background-color: #f6f7f9;
    border-radius: 28rpx;
    width: 148rpx;
  }
  .image_5 {
    margin-top: 14rpx;
    flex-shrink: 0;
    border-radius: 50%;
    width: 17rpx;
    height: 17rpx;
  }
  .text_1 {
    margin-left: 12rpx;
    color: #333333;
    font-size: 28rpx;
    font-family: '.AppleSystemUIFont';
    line-height: 33rpx;
  }
  .image_7 {
    border-radius: 16rpx;
    width: 160rpx;
    height: 160rpx;
  }
  .group_9 {
    margin-left: 24rpx;
    align-self: center;
  }
  .text_11 {
    color: #333333;
    font-size: 24rpx;
    font-family: '.AppleSystemUIFont';
    line-height: 28rpx;
  }
  .text_5 {
    color: #333333;
    font-size: 26rpx;
    font-family: '.AppleSystemUIFont';
    line-height: 30rpx;
  }
  .text_7 {
    margin-top: 23rpx;
    color: #333333;
    font-size: 26rpx;
    font-family: '.AppleSystemUIFont';
    line-height: 30rpx;
  }
  .text_9 {
    margin-top: 29rpx;
    color: #333333;
    font-size: 26rpx;
    font-family: '.AppleSystemUIFont';
    line-height: 30rpx;
  }
  .page {
    background-color: #f6f7f9ff;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
  }
  .group_4 {
    padding: 20rpx 0 58rpx;
    flex: 1 1 auto;
    overflow-y: auto;
  }
  .list {
    margin: 0 24rpx;
  }
  .list-item:not(:first-of-type) {
    margin-top: 20rpx;
  }
</style>